<template>
    <el-popover v-model="cronPopover">
        <cron @change="change" @close="cronPopover=false" i18n="en"
            :value="value"
        ></cron>
        <el-input slot="reference" placeholder="请输入定时策略" readonly
            @input="change" @click="cronPopover=true" :value="value"
        ></el-input>
    </el-popover>
</template>

<script>
import cron from './base.vue'

export default {
    components: {cron},
    data() {
        return {
            cronPopover: false,
        }
    },
    model: {
        prop: 'value',
        event: 'change'
    },
    props: {
        value: {
            default() {
                return '';
            }
        },
        config: {
            default() {
                return {};
            }
        },
    },
    computed: {
        // newValue() {
        //     console.log("🚀 ~ file: cfg-trans-cascader.vue:42 ~ computed newValue ", 
        //         this.value, this.param1, this.param2)
        //     return [this.value[this.param1], this.value[this.param2]]
        // }
    },
    methods: {
        change(val) {
            console.log("🚀 ~ file: cfg-cronExpression.vue:36 ~ change ~ val:", val)
            this.$emit('change', val)
        }
    }
}
</script>
